package com.gitee.cirnochat.file.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gitee.cirnochat.file.model.entity.FileStorageRecord;
import com.gitee.cirnochat.file.service.function.UploadFailedCallBack;
import com.gitee.cirnochat.file.service.function.UploadSuccessCallBack;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
* @author FlanChan
* @description 针对表【file_storage_record(文件储存记录)】的数据库操作Service
* @createDate 2025-04-23 11:56:08
*/
public interface FileStorageRecordService extends IService<FileStorageRecord> {

    FileStorageRecord getFileStorageRecordByMD5(String md5);

    FileStorageRecord saveFileStorageRecord(String extension, String contentType, String url, String md5, File tempFile);

    void uploadFile(MultipartFile file,
                    String uploadPathPrefix,
                    String previewHost,
                    boolean unique,
                    UploadSuccessCallBack successHandler,
                    UploadFailedCallBack failedHandler);
}
